{include file=$header_start}
{include file=$header_end}

 <div class="contain">
 
      {include file=$left_menu}
      
      <div class="right_contain">
        <div class="heading_box">Dashboard</div>
         
        <div class="whitebox">
        {if $msg}
         <div class="masg_div">{$msg}</div>
         {/if}
          <div class="dashboard_leftcontain">
          <div class="dashboard_quicklinkbox">
            <div class="quicklinks">
             <h2><span>Quick Links</span> Popular shortcuts</h2>
             <ul>
             <!-- CMS DashBoard Start-->
              <li>
                  {if $mod_per[1] eq '1'}
                  <a href="{$siteroot}/admin/home.php?q=cms">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon1.png" /></div>                    
                    <div class="topic_name">CMS</div>
                  </a>
                  {else}
                   <a href="{$siteroot}/admin/home.php">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon1.png" title="No Permission" /></div>                    
                    <div class="topic_name">CMS</div>
                  </a>
                  {/if}

              </li>
              <!-- CMS DashBoard End-->
             
               <!-- Manageusers DashBoard Start-->
             <li>
              	 {if $mod_per[14] eq '1'}
                  <a href="{$siteroot}/admin/home.php?q=homeowneruser">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon3.png" /></div>                    
                    <div class="topic_name">Homeowner</div>
                  </a>
                  {else}
                  <a href="{$siteroot}/admin/home.php">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon3.png" title="No Permission"/></div>                    
                    <div class="topic_name">Homeowner</div>
                  </a>
                  {/if}

              </li>
              <li>
              	 {if $mod_per[19] eq '1'}
                  <a href="{$siteroot}/admin/home.php?q=tradesmanuser">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon3.png" /></div>                    
                    <div class="topic_name">Tradesman</div>
                  </a>
                  {else}
                  <a href="{$siteroot}/admin/home.php">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon3.png" title="No Permission"/></div>                    
                    <div class="topic_name">Tradesman</div>
                  </a>
                  {/if}

              </li>
              <!-- Manageusers DashBoard End-->
             
             <!-- Payment History DashBoard Start-->
             <li>
              	  {if $mod_per[25] eq '1'}
                  <a href="{$siteroot}/admin/home.php?q=paymenthistory">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon4.png" /></div>                   
                    <div class="topic_name">Report</div>
                  </a>
                  {else}
                  <a href="{$siteroot}/admin/home.php">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon4.png"  title="No Permission"/></div>                   
                    <div class="topic_name">Report</div>
                  </a>
                  {/if}

             </li>
              <!-- Payment History End-->
              
              <!-- Sitesettings DashBoard Start-->
              <li>
				{if $smarty.session.admin_type eq '1'  && $mod_per[6] eq '1'}              
                  <a href="{$siteroot}/admin/home.php?q=sitesettings">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon2.png" /></div>                    
                  
                  <div class="topic_name">Settings</div></a>
                  {elseif $mod_per[6] eq '1'}
                  <a href="{$siteroot}/admin/home.php?q=defaultseo">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon2.png" /></div>                   
                        
                  <div class="topic_name">Settings</div> </a>          
                  {else}
                  <a href="{$siteroot}/admin/home.php">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon2.png" title="No Permission"/></div>                    
                  
                  <div class="topic_name">Settings</div></a>
                  {/if}
                 
              </li>
              <!-- Sitesettings DashBoard End-->
              
              
                <!-- Payment History DashBoard Start-->
             <li>
              	  {if $mod_per[24] eq '1'}
                  <a href="{$siteroot}/admin/home.php?q=messages">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon5.png" /></div>   
                    <div class="topic_name">Messages</div>                
                  </a>
                  {else}
                  <a href="{$siteroot}/admin/home.php">
                    <div class="topic_icon"><img src="{$siteroot}/templates/admin/img/topic_icon5.png"  title="No Permission"/></div>    
                    <div class="topic_name">Messages</div>               
                  </a>
                  {/if}
                   
             </li>
              <!-- Payment History End-->
              
              <div class="clear"></div>
             </ul>
            </div>
          </div>
          </div>
          <div class="dashboard_rightcontain">
           
            <div>
          <ul id="menu1">
           {if $mod_per[19] eq '1'}
            <li> <a href="#" class="active">Recently Registered Tradesman</a>
              <ul>
              
            <div class="table_view">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_viewbox">
              <tr>
                <th align="center">#</th>
                <th>Username</th>
                <th>Email</th>
                <th>Registerd Date</th>
                <th>Action</th>
              </tr>
              {section name=i loop=$tradesmanArray} 
              <tr>
                <td align="center">{$smarty.section.i.iteration}</td>
               <!-- <td>{$userArray[i].first_name}&nbsp;{$userArray[i].last_name}</td>-->
                <td>{$tradesmanArray[i].username|ucfirst}</td>
                <td>{$tradesmanArray[i].email}</td>
                <td>{$tradesmanArray[i].registered_date|date_format}</td>
                <td>
                    <span><img src="{$siteroot}/templates/admin/img/icon-search.png" onclick="javascript: window.location='{$siteroot}/admin/home.php?q=detailtradesmanuser&id={$tradesmanArray[i].id|base64_encode}';" style="cursor:pointer;" /></span>
                </td>
              </tr>
              {sectionelse}
               <tr>
               	 <td colspan="5"><div class="error" align="center">Oops, Sorry there are no tradesman user.</div></td>
               </tr>
               {/section}
            </table>
            </div>
              </ul>
            </li>
            {/if}
               
            {if $mod_per[14] eq '1'}
            <li> <a href="#" class="active">Recently Registered HomeOwner</a>
              <ul>
              
            <div class="table_view">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_viewbox">
              <tr>
                <th align="center">#</th>
                <th>Username</th>
                <th>Email</th>
                <th>Registerd Date</th>
                <th>Action</th>
              </tr>
              {section name=i loop=$homeownerArray} 
              <tr>
                <td align="center">{$smarty.section.i.iteration}</td>
               <!-- <td>{$userArray[i].first_name}&nbsp;{$userArray[i].last_name}</td>-->
                <td>{$homeownerArray[i].username|ucfirst}</td>
                <td>{$homeownerArray[i].email}</td>
                <td>{$homeownerArray[i].registered_date|date_format}</td>
                <td>
                    <span><img src="{$siteroot}/templates/admin/img/icon-search.png" onclick="javascript: window.location='{$siteroot}/admin/home.php?q=detailhomeowneruser&id={$homeownerArray[i].id|base64_encode}';" style="cursor:pointer;" /></span>
                </td>
              </tr>
               {sectionelse}
               <tr>
               	 <td colspan="5"><div class="error" align="center">Oops, Sorry there are no homeowner user.</div></td>
               </tr>
               {/section}
            </table>
            </div>
              </ul>
            </li>
            {/if}
              
          {if $mod_per[14] eq '1'}
            <li> <a href="#" class="active">Recently Posted Jobs</a>
              <ul>
              
            <div class="table_view">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_viewbox">
              <tr>
                <th align="center">#</th>
                <th width="20%">Trade Category</th>
                <th width="15%">Job Type</th>
                <th width="25%" >Job Description</th>
                <th width="20%">Posted Date</th>
                <th width="20%">Action</th>
              </tr>
              {section name=i loop=$postedjobArray} 
              <tr>
                <td align="center">{$smarty.section.i.iteration}</td>
               <!-- <td>{$userArray[i].first_name}&nbsp;{$userArray[i].last_name}</td>-->
                <td>{$postedjobArray[i].trade_category|ucfirst}</td>
                <td>{$postedjobArray[i].jobtype_name}</td>
                <td>{$postedjobArray[i].job_desc|substr:0:25}{if $postedjobArray[i].job_desc|strlen gt '25'}...{/if}</td>
                <td>{$postedjobArray[i].date_added|date_format}</td>
                <td>
                    <span><img src="{$siteroot}/templates/admin/img/icon-search.png" onclick="javascript: window.location='{$siteroot}/admin/home.php?q=postjobdetail&userid={$postedjobArray[i].user_id|base64_encode}&id={$postedjobArray[i].postjob_id|base64_encode}';" style="cursor:pointer;" /></span>
                </td>
              </tr>
              {sectionelse}
               <tr>
               	 <td colspan="6"><div class="error" align="center">Oops, Sorry there are no jobs.</div></td>
               </tr>
               {/section}
            </table>
            </div>
              </ul>
            </li>
            {/if}
            
            {if $mod_per[17] eq '1'}
            <li> <a href="#" class="active">Recently Inquiry</a>
              <ul>
              
            <div class="table_view">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_viewbox">
              <tr>
                <th align="center">#</th>
                <th width="20%">Name</th>
                <th width="15%">Status</th>
                <th width="25%" >Admin Reply</th>
                <th width="20%">Email</th>
                <th width="20%">Action</th>
              </tr>
              {section name=i loop=$contactArray} 
              <tr>
                <td align="center">{$smarty.section.i.iteration}</td>
               <!-- <td>{$userArray[i].first_name}&nbsp;{$userArray[i].last_name}</td>-->
                {if $contactArray[i].status eq unanswered}
                <td>
               <strong>{$contactArray[i].name}</strong>
                </td>
                {else}
                 <td>
				{$contactArray[i].name}
                </td>
                {/if}
	            <td>{$contactArray[i].readflag}</td>
                <td>{$contactArray[i].status}</td>
                <td>{$contactArray[i].email_id}</td>

                <td>
                  <span><img src="{$siteroot}/templates/admin/img/icon-search.png" onclick="javascript: window.location='{$siteroot}/admin/home.php?q=detail_contact&id={$contactArray[i].id|base64_encode}&page={$page}';" style="cursor:pointer;" /></span>
                </td>
              </tr>
              {sectionelse}
               <tr>
               	 <td colspan="6"><div class="error" align="center">Oops, Sorry there are no inquiry.</div></td>
               </tr>
               {/section}
            </table>
            </div>
              </ul>
            </li>
            {/if}
            
            {if $mod_per[24] eq '1'}
            <li> <a href="#" class="active">Recently Messages</a>
              <ul>
              
            <div class="table_view">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_viewbox">
              <tr>
                <th align="center">#</th>
                <th width="20%">From Name</th>
                <th width="20%">To Name</th>
                <th width="25%" >Subject</th>
                <th width="20%">Date</th>
                <th width="15%">Action</th>
              </tr>
              {section name=i loop=$msgArray} 
              <tr>
                <td align="center">{$smarty.section.i.iteration}</td>
                <td>{$msgArray[i].from_name|ucwords}</td>
                <td>{$msgArray[i].to_name|ucwords}</td>
                <td>{$msgArray[i].subject|ucwords|truncate:25:"..."}</td>
                <td>{$msgArray[i].send_date}</td>                

                <td>
                  <span><img src="{$siteroot}/templates/admin/img/icon-search.png" onclick="javascript: window.location='{$siteroot}/admin/home.php?q=detail_msg&id={$msgArray[i].id|base64_encode}&page={$page}';" style="cursor:pointer;" /></span>
                </td>
              </tr>
              {sectionelse}
               <tr>
               	 <td colspan="6"><div class="error" align="center">Oops, Sorry there are no messages.</div></td>
               </tr>
               {/section}
            </table>
            </div>
              </ul>
            </li>
            {/if}
              
          </ul>
          
        </div>
        
          
          </div>
          <div class="clear"></div>         
          
        </div>
      </div>
      
      
      <!--right_contain end-->
      <div class="clear"></div>
    </div>
    
{include file=$footer}